/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package utils;


import entities.Event;
import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author Trong Nguyen
 */
public class SumaryPrize {

    private Event event;
    private List<WinnerDetails> winnerList;
    private WinnerDetails selected;

    public SumaryPrize() {
        winnerList = new ArrayList<WinnerDetails>();
    }

    public SumaryPrize(Event event) {
        this.event = event;
    }

    public Event getEvent() {
        return event;
    }

    public void setEvent(Event event) {
        this.event = event;
    }

    public List<WinnerDetails> getWinnerList() {
        if(null==winnerList){
            winnerList = new ArrayList<WinnerDetails>();
        }
        return winnerList;
    }

    public void setWinnerList(List<WinnerDetails> winnerList) {
        this.winnerList = winnerList;
    }

    public WinnerDetails getSelected() {
        return selected;
    }

    public void setSelected(WinnerDetails selected) {
        this.selected = selected;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final SumaryPrize other = (SumaryPrize) obj;
        if ((this.event == null || !this.event.getEventId().equalsIgnoreCase(other.event.getEventId()))) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 5;
        hash = 79 * hash + (this.event != null ? this.event.hashCode() : 0);
        return hash;
    }
}
